﻿namespace RuoVea.Fams.Server.Models;

/// <summary>
/// 资产信息
/// 创建人：Admin
/// 日期：2023年10月12日
/// 描述：资产信息实体模型
/// </summary>
[SugarTable(nameof(FamsAssets), "资产信息")]
public class FamsAssets : EntityBase
{
    /// <summary>
    /// 资产编码
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "资产编码")]
    public string Code { get; set; }

    /// <summary>
    /// 资产名称
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "资产名称")]
    public string Name { get; set; }

    /// <summary>
    /// 资产类型
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "资产类型")]
    public string Type { get; set; }

    /// <summary>
    /// 规格型号
    /// </summary>
    [MaxLength(100)]
    [SugarColumn(ColumnDescription = "规格型号", IsNullable = true)]
    public string Specification { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "单位")]
    public string Unit { get; set; }

    /// <summary>
    /// 使用部门
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "使用部门")]
    public string Department { get; set; }

    /// <summary>
    /// 存放位置
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "存放位置")]
    public string Location { get; set; }

    /// <summary>
    /// 购入日期
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "购入日期")]
    public DateTime PurchaseDate { get; set; }

    /// <summary>
    /// 折旧开始日期
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "折旧开始日期")]
    public DateTime DepreciationStartDate { get; set; }

    /// <summary>
    /// 资产原值
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "资产原值")]
    public decimal OriginalValue { get; set; }

    /// <summary>
    /// 预计使用年限（年）
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "预计使用年限（年）")]
    public int UsefulLife { get; set; }

    /// <summary>
    /// 残值率（%）
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "残值率（%）", DefaultValue = "0.00")]
    public decimal ResidualRate { get; set; }

    /// <summary>
    /// 每月折旧金额
    /// </summary>
    [SugarColumn(ColumnDescription = "每月折旧金额", IsNullable = true)]
    public decimal? MonthlyDepreciation { get; set; }

    /// <summary>
    /// 累计折旧
    /// </summary>
    [SugarColumn(ColumnDescription = "累计折旧", IsNullable = true)]
    public decimal? AccumulatedDepreciation { get; set; }

    /// <summary>
    /// 已折旧年限（年）
    /// </summary>
    [SugarColumn(ColumnDescription = "已折旧年限（年）", IsNullable = true)]
    public int? DepreciationYears { get; set; }

    /// <summary>
    /// 资产净值
    /// </summary>
    [SugarColumn(ColumnDescription = "资产净值", IsNullable = true)]
    public decimal? NetValue { get; set; }

    /// <summary>
    /// 资产状态
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "资产状态", IsNullable = true)]
    public string Status { get; set; }

    /// <summary>
    /// 报废日期
    /// </summary>
    [SugarColumn(ColumnDescription = "报废日期", IsNullable = true)]
    public DateTime? DisposalDate { get; set; }

    /// <summary>
    /// 报废原因
    /// </summary>
    [MaxLength(200)]
    [SugarColumn(ColumnDescription = "报废原因", IsNullable = true)]
    public string DisposalReason { get; set; }
}